<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    function _new(Fn, ...args) {//...args拿到剩余参数数组
        let obj = Object.create(Fn.prototype) //创建空对象，并且原型指向Fn
        let res = Fn.call(obj, ...args)
        if (res !== null && (typeof res === 'Object' || typeof res === 'function')) {
            return res
        }
        return obj
    }

    function xiaoPang() {
        get:() => {
            console.log('111')
        }
    }

    let xiaoxiaoPang = _new(xiaoPang, '小小胖').get()
    console.log(xiaoxiaoPang)
</script>
</body>
</html>